<template>
  <div class="wscn-http404-container">
    <div class="wscn-http404">
      <div class="pic-404">
        <img class="pic-404__parent" src="../../assets/error/wrong.png" alt="500">
      </div>
      <div class="bullshit">
        <div class="bullshit__oops">
          抱歉!
        </div>

        <div class="bullshit__info">
          {{ msg }}
        </div>
        <div>
          <router-link :to="{ name: 'Login' }" class="bullshit__return-home bullshit__return-login">
            去登录
          </router-link>
          <span class="bullshit__return-home" @click="back()">返回</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Page500',
  data() {
    return {
      msg: null
    }
  },
  created() {
    if (this.$route.query.msg) this.msg = decodeURIComponent(this.$route.query.msg)
    else this.msg = '服务器异常，请稍后再试！'
  },
  methods: {
    back() {
      if (this.$route.query.noGoBack) {
        this.$router.push({ path: '/home' })
      } else {
        this.$router.go(-1)
      }
    }
  }
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import './error.scss';
.app-main {
    height: 100vh !important;
}
</style>
